<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=path%>/css/base.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/css/layout.css">
<script src="<%=path%>/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
	$(function() {
		var width = screen.availWidth;
		var height = screen.availHeight;
		$(".wxts").css({
			"width" : width,
			"height" : height
		});
		$(".wxts2").css({
			"width" : width,
			"height" : height
		});
		$("#add").click(function() {
			$("#wxts1").css("display", "block");
			$("[name=name_add]").val("");
			$("[name=phone_add]").val("");
			$("[name=email_add]").val("");
		});
		$("[name=chongzhi]").click(function() {
			$(".wxts2").css("display", "block");
			$("#name_num").text("充值");
			$("[name=num_num]").val("");
			$("#what").prop("name", "phone_num_jia");

			var tb = $(this).parent().parent().children();
			var phone = tb[2].innerHTML;
			var yue = tb[4].innerHTML;
			$("#what").val(phone);
			$("#yuanlai").val(yue);
		});
		$("[name=koufei]").click(function() {
			$(".wxts2").css("display", "block");
			$("#name_num").text("扣费");
			$("[name=num_num]").val("");
			$("#what").prop("name", "phone_num_jian");
			
			var tb = $(this).parent().parent().children();
			var phone = tb[2].innerHTML;
			var yue = tb[4].innerHTML;
			$("#what").val(phone);
			$("#yuanlai").val(yue);
		});
		$("[name=input]").click(function() {
			$("#wxts2").css("display", "block");
			var tb = $(this).parent().parent().children();
			var name = tb[0].innerHTML;
			var level = tb[1].innerHTML;
			var phone = tb[2].innerHTML;
			var email = tb[3].innerHTML;
			var yue = tb[4].innerHTML;
			var jifen = tb[5].innerHTML;
			$("[name=name_xg]").val(name);
			$("[name=level_xg]").val(level);
			$("[name=phone_xgg]").val(phone);
			$("[name=phone_xg]").val(phone);
			$("[name=email_xg]").val(email);
			$("[name=yue_xg]").val(yue);
			$("[name=jifen_xg]").val(jifen);
		});
		$("[name=guanbi]").click(function() {
			$(this).parent().parent().css("display", "none");
		});
		$("[name=delete]").click(function() {
			var tb = $(this).parent().parent().children();
			var phone = tb[2].innerHTML;
			$("[name=delete_phone_]").val(phone);
		});
	});
</script>
<style type="text/css">
.wxts {
	background-color: #000000;
	position: fixed;
	top: 0px;
	left: 0px;
	display: none;
	background: rgba(10, 10, 10, 0.5);
}

.wxts_ts {
	text-align: center;
	background-color: #FFFFFF;
	width: 350px;
	height: 330px;
	margin: 18% auto;
	border-radius: 6px;
}

.wxts_ts h1 {
	padding-top: 10px;
}

.wxts_ts p {
	margin-top: 20px;
}

.wxts2 {
	background-color: #000000;
	position: fixed;
	top: 0px;
	left: 0px;
	display: none;
	background: rgba(10, 10, 10, 0.5);
}

.wxts2_ts {
	text-align: center;
	background-color: #FFFFFF;
	width: 350px;
	height: 140px;
	margin: 18% auto;
	border-radius: 6px;
}

.wxts2_ts h1 {
	padding-top: 10px;
}

.wxts2_ts p {
	margin-top: 20px;
}
</style>
</head>
<body>
	<form action="backstage_member" method="post">
		<div class="bsinfo">
			<div class="bsinfo_title">会员管理</div>
			<div class="fd">
				<input
					style="height: 30px; width: 150px; margin-top: 18px; margin-left: 50px; margin-right: 10px; padding-left: 1em;"
					name="select_member">
			</div>
			<input type="submit" class="slideshow_btn fd" value="查询"
				style="width: 92px; height: 37px">
			<div class="slideshow_btn fdr" id="add">添加</div>
			<div class="bsinfo_body">
				<div class="bsinfo_body_box">
					<table
						style="width: 100%; border: 1px solid #D9D9D9; text-align: center; font-size: 14px;"
						cellpadding="0" cellspacing="0">
						<tr>
							<td>姓名</td>
							<td>会员等级</td>
							<td>联系电话</td>
							<td>email</td>
							<td>余额</td>
							<td>可用积分</td>
							<td style="width: 20%;">操作</td>
						</tr>
						<c:forEach items="${list }" var="a">
							<tr>
								<td>${a.getName()}</td>
								<td>${a.getMember_level()}</td>
								<td>${a.getPhone()}</td>
								<td>${a.getEmail() }</td>
								<td>${a.getAccount_balance() }</td>
								<td>${a.getMember_points() }</td>
								<td style="width: 20%;"><input type="button" value="修改"
									name="input"> <input type="button" value="充值"
									name="chongzhi"> <input type="button" value="扣费"
									name="koufei"> <input type="submit" value="删除"
									name="delete">
									<input type="hidden"  name="delete_phone_" ></td>
							</tr>
						</c:forEach>
					</table>
				</div>
			</div>
		</div>
		<div class="wxts" id="wxts1">
			<div class="wxts_ts">
				<h1 id="title_name">添加</h1>
				<br> &nbsp;&nbsp;姓&nbsp;&nbsp;&nbsp;&nbsp;名&nbsp;：<input
					type="text" name="name_add"> <br>
				<br> 会员等级：<input type="text" value="0级" disabled="disabled"><br>
				<br> 联系电话：<input type="text" name="phone_add"><br>
				<br> &nbsp;&nbsp;email&nbsp;&nbsp;：<input type="text"
					name="email_add"><br>
				<br> &nbsp;&nbsp;余&nbsp;&nbsp;&nbsp;&nbsp;额&nbsp;：<input
					type="text" disabled="disabled" value="0.0"><br>
				<br> 可用积分：<input type="text" disabled="disabled" value="0.0"><br>
				<br> <input type="submit" value="添加">&nbsp;&nbsp;&nbsp;&nbsp;<input
					type="button" name="guanbi" value="关闭">
			</div>
		</div>
		<div class="wxts" id="wxts2">
			<div class="wxts_ts">
				<h1 id="title_name">修改</h1>
				<br> &nbsp;&nbsp;姓&nbsp;&nbsp;&nbsp;&nbsp;名&nbsp;：<input
					type="text" disabled="disabled" name="name_xg"> <br>
				<br> 会员等级：<input type="text" disabled="disabled"
					name="level_xg"><br>
				<br> 联系电话：<input type="text" name="phone_xgg"
					disabled="disabled"><input type="hidden" name="phone_xg"
					><br>
				<br> &nbsp;&nbsp;email&nbsp;&nbsp;：<input type="text"
					name="email_xg"><br>
				<br> &nbsp;&nbsp;余&nbsp;&nbsp;&nbsp;&nbsp;额&nbsp;：<input
					type="text" disabled="disabled" name="yue_xg"><br>
				<br> 可用积分：<input type="text" disabled="disabled"
					name="jifen_xg"><br>
				<br> <input type="submit" value="修改">&nbsp;&nbsp;&nbsp;&nbsp;<input
					type="button" name="guanbi" value="关闭">
			</div>
		</div>
		<div class="wxts2">
			<div class="wxts2_ts">
				<h1 id="name_num"></h1>
				<br> <input type="hidden" id="what"> 
				<input	type="hidden" id="yuanlai" name="num_yue"> 金额：
				<input	type='text' name="num_num"	onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)"
					onblur="this.v();" /><br>
				<br> <input type="submit" value="修改">&nbsp;&nbsp;&nbsp;&nbsp;<input
					type="button" name="guanbi" value="关闭">
			</div>
		</div>
	</form>
</body>
</html>